package dao

import "gorm.io/gorm"

type User struct {
	gorm.Model
	Name   string `gorm:"type:varchar(20);not null;comment:名称"`
	Mobile string `gorm:"type:char(11);not null;comment:手机号"`
	Pass   string `gorm:"type:varchar(40);not null;comment:密码"`
}

func (User) TableName() string {
	return "user"
}

type HomePage struct {
	gorm.Model
	Name               string `gorm:"type:varchar(20);not null;comment:名称"`
	AccountNumber      string `gorm:"type:varchar(30);not null;comment:账号"`
	Address            string `gorm:"type:varchar(50);not null;comment:地址"`
	FollowWithInterest int    `gorm:"type:int(11);not null;comment:关注"`
	Fans               int    `gorm:"type:int(11);not null;comment:粉丝"`
	GetThumbsUp        int    `gorm:"type:int(11);not null;comment:获赞"`
	Works              int    `gorm:"type:int(11);not null;comment:作品"`
	Hobby              int    `gorm:"type:int(11);not null;comment:喜欢"`
}

func (HomePage) TableName() string {
	return "homePage"
}

type Works struct {
	gorm.Model
	Title         string `gorm:"type:varchar(50);not null;comment:标题"`
	Music         string `gorm:"type:varchar(255);not null;comment:音乐"`
	Video         string `gorm:"type:varchar(255);not null;comment:视频"`
	Picture       string `gorm:"type:varchar(255);not null;comment:图片"`
	SubjectOfTalk string `gorm:"type:varchar(50);not null;comment:话题"`
	Types         string `gorm:"type:varchar(20);not null;comment:类型"`
}

func (Works) TableName() string {
	return "works"
}

type GiveThumbsUp struct {
	gorm.Model
	UserId  int    `gorm:"type:int(11);not null;comment:用户ID"`
	WorksId int    `gorm:"type:int(11);not null;comment:作品ID"`
	Drop    string `gorm:"type:varchar(20);not null;comment:赞"`
}

func (GiveThumbsUp) TableName() string {
	return "giveThumbsUp"
}

type Discuss struct {
	gorm.Model
	UserId  int    `gorm:"type:int(11);not null;comment:用户ID"`
	WorksId int    `gorm:"type:int(11);not null;comment:用户ID"`
	Content string `gorm:"type:varchar(50);not null;comment:内容"`
}

func (Discuss) TableName() string {
	return "discuss"
}
